package com.example.common.logmapper;


import com.example.model.log.pojo.Log;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface LogMapper {


    @Insert("insert into sm.logs (username, operationtime, classname, methodname, duration) VALUES (#{username} ,#{operationTime}, #{className}, #{methodName}, #{duration})")
    void insert(String username, LocalDateTime operationTime, String className, String methodName, long duration);
    @Select("select * from sm.logs order by ID desc")
    List<Log> selectAllLogs();
}
